\subsection{Gravity}
The gravitational force experienced by a mass \(m\) at position vector \(\vb r\) relative to a mass \(M\) is given by
\[
	\vb F = \frac{- G M m}{\abs{\vb r}^3} \cdot \vb r = \frac{- G M m}{\abs{\vb r}^2} \cdot \vu{r}
\]
This is a conservative force:
\[
	\vb F(\vb r) = -\grad V(\vb r);\quad V(\vb r) = \frac{-GMm}{r}
\]
To remove the factor of \(m\), we define the `gravitational potential' \(\Phi_g\) to be
\[
	\Phi_g(\vb r) = \frac{-GM}{r}
\]
We further define the gravitational field
\[
	\vb g(\vb r) = -\grad \Phi_g(\vb r) = \frac{-GM}{r^2}\vu{r}
\]
Note that this is dependent only on \(M\), and not \(m\).
These quantities are related to \(\vb F\) and \(V\) by scale factors of \(m\).
\[
	V(\vb r) = m \Phi_g(\vb r);\quad \vb F(\vb r) = m\vb g
\]
We can generalise these expressions to define the gravitational potential associated with many point masses \(M_i\) for \(i = 1, \dots, n\).
Then,
\[
	\Phi_g(\vb r) = -\sum_{i=1}^n \frac{GM_i}{\abs{\vb r - \vb r_i}}
\]
\[
	\vb g(\vb r) = -\sum_{i=1}^n \frac{GM_i}{\abs{\vb r - \vb r_i}^3}(\vb r - \vb r_i)
\]
We can extend this to a continuous mass distribution by generalising the summation into an integral.
In particular, for a uniform spherical distribution of mass centred at the origin, we have that outside the sphere
\[
	\Phi_G(\vb r) = \frac{-GM}{r}
\]
which is equivalent to the formula for a point mass at the origin.
So we can represent any spherical distribution of mass as a particle, provided we never consider behaviour inside the sphere.

\subsection{Gravitational and inertial mass}
Note that in the equations for gravitational force, mass plays two roles.
\begin{itemize}
	\item Inertial mass: In Newton's second law, \(m \ddot{\vb r} = \vb F\) shows that the mass encapsulates the resistance to motion
	\item Gravitational mass: In the law of gravitation, \(\vb F = \frac{-GMm}{r^2}\vu{r}\), showing the scale factor by which the mass affects the force.
\end{itemize}
It turns out that these `masses' are not exactly the same; they differ by a factor of around \num{1e-12}.
In this course, we will consider these masses to be identical since the factor is very small.

\subsection{One-dimensional approximation to gravity}
Let us consider a one-dimensional approximation.
Consider a mass \(m\) at some height \(z\) above the surface of a planet of mass \(M\) and radius \(R\), where \(z \ll R\).
Using the binomial expansion, the potential is approximated by
\[
	V(R + z) = \frac{-GMm}{R + z} \approx \frac{-GMm}{R} + \frac{GMmz}{R^2} - \dots
\]
The first term in the expansion is a constant, and the second term is \(mgz\) where \(g\) is a constant.
So when \(z \ll R\),
\[
	V(R + z) \approx mgz;\quad g = \frac{GM}{R^2} \approx \SI{9.8}{\metre\per\second\squared}
\]

\subsection{Escape velocity}
Consider a particle leaving the surface of a planet of mass \(M\) and radius \(R\), starting with velocity \(v\).
Can this particle escape the gravitational attraction of the planet, and fly off to infinity?
By conservation of energy,
\[
	E = T + V = \frac{1}{2}mv^2 - \frac{GMm}{r}
\]
If \(E < 0\), the particle does not have sufficient energy to leave the `potential well' \(V\).
If \(E > 0\), the particle can escape to infinity.
The critical velocity \(v_0\) at which the particle can escape with lowest energy (the escape velocity) is therefore computed by setting \(E = 0\) at \(r=R\), i.e.
\[
	\frac{1}{2}v_0^2 = \frac{GM}{R} \implies v_0 = \sqrt{\frac{2GM}{R}}
\]
Note that light has a finite velocity, \(c\).
Therefore it must be possible that a mass is large enough that even the speed of light is insufficient for a particle to escape from a given radius.
This describes a black hole.
Of course, at this point we would need to invoke Einstein's theory of relativity in order to properly describe the behaviour of such an object.

\subsection{Electromagnetism}
We know that the force \(\vb F\) acting on a particle with charge \(q\) is
\[
	\vb F = q\vb E + q\dot{\vb r} \times \vb B
\]
where \(\vb E, \vb B\) are functions of \(\vb r\) and \(t\).
This is known as the Lorentz force law.
Let us first consider time-independent fields \(\vb E(\vb r), \vb B(\vb r)\) as a simplification.
In this case, we can write
\[
	\vb E = -\grad \Phi_e(\vb r)
\]
where \(\Phi_e\) is the electrostatic potential.
The force \(q\vb E\) is therefore conservative.
We now prove that for time independent \(\vb E(\vb r)\) and \(\vb B(\vb r)\), \(\vb F\) is conservative.
\begin{proof}
	\begin{align*}
		E                     & = \frac{1}{2}m \abs{\dot{\vb r}}^2 + q\Phi_e(\vb r)                         \\
		\frac{\dd{E}}{\dd{t}} & = m \dot{\vb r} \cdot \ddot{\vb r} + q\dot{\vb r} \cdot \grad \Phi_e(\vb r) \\
		                      & = \dot{\vb r} \cdot (m \ddot{\vb r} + q\grad \Phi_e)                        \\
		                      & = \dot{\vb r} \cdot (q \vb E + q \dot{\vb r} \times \vb B + q \grad \Phi_e) \\
		                      & = \dot{\vb r} \cdot (q \dot{\vb r} \times \vb B)                            \\
		                      & = 0
	\end{align*}
	since this is a triple product where two of the vectors are parallel.
	Since \(\vb B\) acts perpendicular to the velocity, it does not do work on the particle.
\end{proof}
Analogously to point masses, we may consider point charges.
A particle with charge \(Q\) located at the origin generates an electrostatic potential and electric field
\[
	\Phi_e(\vb r) = \frac{Q}{4\pi\varepsilon_0 r};\quad \vb E(\vb r) = -\grad \Phi_e = \frac{Q}{4\pi\varepsilon_0 r^2}\vu{r}
\]
where \(\varepsilon_0 = \SI{8.85e-12}{\per\metre\cubed\per\kilogram\second\squared\coulomb\squared}\) is the electric constant.
So the force on a particle of charge \(q\) located at \(\vb r\) is given by
\[
	\vb F = -q\grad \Phi_e = \frac{Qq}{4\pi\varepsilon_0 r^2}\vu{r}
\]
This is called the Coulomb force.
A negative sign is an attractive force; a positive sign is a repulsive force.
This can be seen by considering a perturbation from the origin.
